package demomoreinher;

/**
 * @Author 12629
 * @Description：
 */
public class Test {
    public static void eatFunc(Animal animal) {
        animal.eat();
    }
    public static void walk(IRunning running) {
        running.run();
    }
    public static void main(String[] args) {
        walk(new Duck("唐老鸭",10));
        walk(new Dog("小虎",5));
        walk(new Robot());
    }
    public static void main1(String[] args) {
        eatFunc(new Duck("唐老鸭",10));
        eatFunc(new Fish("小鱼儿",3));
    }
}